using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Helper;
namespace CoreData
{
    public class account
    {
            public long userid{get;set;}
            public int mainaccount{get;set;}
            public int bonusaccount{get;set;}
            public string message{get;set;}
            public long accconfigid{get;set;}
            public long id { get; set; }
         
        public account()
        {       
                    message ="";   
        }
        
       static account DynamicCast<T>(object row_data, object row_header) where T : account
       {
           // row_data : DataRow
           // row_header : DataColumnCollection
           account ret = new account();
           DataRow dt = (DataRow)row_data;

           foreach (DataColumn column in (DataColumnCollection)row_header)
           {
               switch (column.ColumnName)
               {
                   case "id":
                       ret.id = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "userid":
                        ret.userid = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "mainaccount":
                        ret.mainaccount = ConvertObject.ToInt(dt[column]);
                       break;
                      case  "bonusaccount":
                        ret.bonusaccount = ConvertObject.ToInt(dt[column]);
                       break;
                      case  "message":
                        ret.message = ConvertObject.ToString(dt[column]);
                       break;
                      case  "accconfigid":
                        ret.accconfigid = ConvertObject.ToLong(dt[column]);
                       break;
                
                   default:
                       break;
               }
           }

           return ret;
       }
        
    }
}
